package com.sasis.dao.ibatis;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.sasis.dao.RoleFunctionPermissionDao;
import com.sasis.model.RoleFunctionPermission;

public class RoleFunctionPermissionDaoIbatisImpl extends BaseDaoIbatisImpl implements RoleFunctionPermissionDao {

	public RoleFunctionPermissionDaoIbatisImpl() {
		super(RoleFunctionPermission.class);
	}

	public RoleFunctionPermission loadByPermission(Long roleId, Long functionId) {
		Map params = new HashMap();
		params.put("roleId", roleId);
		params.put("functionId", functionId);
		return (RoleFunctionPermission) getSqlMapClientWrapper().queryForObject("loadByPermission", params);
	}
	
	public Collection findByAllow(Long roleId) {
		return getSqlMapClientWrapper().queryForList("findByAllow", roleId);
	}
}